﻿function switchViews(obj, row) {
    var div = document.getElementById(obj);
    var img = document.getElementById('img' + obj);

    if (div.style.display == "none") {
        div.style.display = "inline";
        if (row == 'alt') {
            img.src = "../Images/expand_button_down.png";
            mce_src = "../Images/expand_button_down.png";
        }
        else {
            img.src = "../Images/expand_button.png";
            mce_src = "../Images/expand_button.png";
        }
        img.alt = "Cerrar para ver otros Recursos";
    }
    else {
        div.style.display = "none";
        if (row == 'alt') {
            img.src = "../Images/expand_button.png";
            mce_src = "../Images/expand_button.png";
        }
        else {
            img.src = "../Images/expand_button.png";
            mce_src = "../Images/expand_button.png";
        }
        img.alt = "Expand para mostrar Recursos";
    }
}


function redondear(cantidad, decimales) {
    //http://www.bruzelan.es/foro/index.php?topic=3053.10;wap2

    var cantidad = parseFloat(cantidad);
    var decimales = parseFloat(decimales);
    decimales = (!decimales ? 2 : decimales);
    return Math.round(cantidad * Math.pow(10, decimales)) / Math.pow(10, decimales);
}